package com.xbongbong.saas.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.toolbox.util.DateUtil;
import com.xbongbong.paas.toolbox.wrap.Entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Size;

/**
 * @description: 公海池分组
 * @Author: hongxiao
 * @date: 2019-03-03 16:58
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class PublicGroupEntity extends Entity {
    /**
     * 主键
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 表单id
     */
    private Long formId;
    /**
     * 分组名称
     */
    @Size(min=1, max=50, message="分组名称长度必须在1-50之间")
    private String name;
    /**
     * 排序值
     */
    private Integer sort;
    /**
     * 查询条件json [{"symbol":"2","name":"attr40","data":"史莱姆"}]
     */
    private JSONArray jsonData;
    /**
     * 是否启用0.不启用 1.启用 默认1
     */
    private Integer enable;
    /**
     * 可见范围权限是否开启0.不启用 1.启用 默认1
     */
    private Integer scopeEnable;
    /**
     * [{property: "dept", editable: 1, id: 5, name: "研发部"},
     * {property: "role", editable: 1, id: "2", name: "角色2"},
     * {property: "user", editable: 1, id: "1", name: "张杰"}]
     */
    private JSONArray scopeRule;
    /**
     * 添加时间
     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 创建人userid
     */
    private String creatorId;
    /**
     * 最近修改人userid
     */
    private String modifierId;
    /**
     * 删除标记
     */
    private Integer del;

    public PublicGroupEntity (){
        long now = DateUtil.getInt();
        formId = 0L;
        sort = 0;
        updateTime = now;
        addTime = now;
        del = 0;
    }
}
